import instance from "@/utils/requestUtils";


let adminApi = {
    //分页条件查询
    searchPage(searchForm) {
        return instance.get('admin', {params: searchForm})
    },

    findById(id) {
        return instance.get(`admin/${id}`)
    },

    addadmin(admin) {
        return instance.post(`admin`, admin);
    },
    updateadmin(admin) {
        return instance.put(`admin`, admin);
    },
    deleteById(id) {
        return instance.delete(`admin/${id}`)
    },
    batchDelete(ids) {
        return instance.delete(`admin/batch/${ids}`)
    },

    //获取所有的角色
    getAllRoleList() {
        return instance('role/list')
    }
}

export default adminApi;
